package leetcode;

public class _1446 {
    /**
     * 连续字符
     */
    class Solution {
        public int maxPower(String s) {
            int n = s.length();
            int i=0;
            int ans = 0;
            while(i<n){
                int start = i;
                i++;
                while(i<n&&s.charAt(i)==s.charAt(start)){
                    i++;
                }
                ans = Math.max(ans,i-start);
            }
            return ans;
        }
    }
}
